import request from '@/utils/request'

const API_NAME = '/admin/user/members'

export default {
  // 获取所有会员
  queryAll() {
    return request({
      url: `${API_NAME}/`,
      method: 'get'
    })
  },
  // 分页获取所有会员
  queryByPage(page, limit, searchObj) {
    return request({
      url: `${API_NAME}/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  // 根据ID删除会员
  deleteById(id) {
    return request({
      url: `${API_NAME}/${id}`,
      method: 'delete'
    })
  },
  // 根据ID修改会员封禁状态
  updateById(id) {
    return request({
      url: `${API_NAME}/${id}`,
      method: 'put'
    })
  },
  // 获取会员数量
  count(){
    return request({
      url: `${API_NAME}/count`,
      method: 'get'
    })
  }
}
